let isProduction = process.env.NODE_ENV === 'production';
let domain = window.document.domain;

let baseUrl = {};

if (isProduction && domain === 'localhost') {

  baseUrl = {
    service: 'http://geohey.com/s/',
    public: 'http://geohey.com/s/public_data/',
    data: 'http://geohey.com/s/data/'
  }

} else if (!isProduction) {

  baseUrl = {
    service: '/s/',
    public: '/s/public_data/',
    data: '/s/data/'
  }

} else {

  baseUrl = {
    service: '/s/',
    public: '/s/public_data/',
    data: '/s/data/'
  }

}

let publicDataCategories = [{
    value: 0,
    label: "全部"
  },
  {
    value: 1,
    label: "区划"
  },
  {
    value: 2,
    label: "教育"
  },
  {
    value: 3,
    label: "生活服务"
  },
  {
    value: 4,
    label: "自然"
  },
  {
    value: 5,
    label: "地产"
  },
  {
    value: 6,
    label: "零售"
  },
  {
    value: 7,
    label: "交通"
  },
  {
    value: 8,
    label: "医疗"
  },
  {
    value: 10,
    label: "设施"
  },
  {
    value: 11,
    label: "餐饮"
  },
  {
    value: 12,
    label: "旅游"
  },
  {
    value: 13,
    label: "工商企业"
  },
  {
    value: 14,
    label: "政府"
  },
  {
    value: 15,
    label: "农业"
  },
  {
    value: 16,
    label: "汽车"
  },
  {
    value: 999,
    label: "其它"
  },
]

let encodings = [{
    value: 0,
    label: 'utf-8'
  },
  {
    value: 1,
    label: 'gbk'
  },
  {
    value: 2,
    label: 'gb2312'
  },
  {
    value: 3,
    label: 'gb18030'
  },
  {
    value: 4,
    label: 'big5'
  },
  {
    value: 5,
    label: 'windows-936'
  },
  {
    value: 6,
    label: 'latin1'
  },
  {
    value: 7,
    label: 'ANSI'
  },
  {
    value: 8,
    label: 'utf-16'
  },
]

let showWgs84DownloadOption = false;

let appNameMapping = {

  'all': {
    name: '所有项目',
    key: 'all',
    icon: 'file1',
    activeIcon: 'floder',
    rootPath: '',
    projects: true,
    view: 'tiling-wrapper'
  },

  'dataviz': {
    name: '数据上图',
    projects: true,
    rootPath: '/s/mapviz/',
    create: '/apps/dataviz/new',
    key: 'dataviz',
    icon: 'dataviz',
    view: 'tiling-wrapper'
  },

  'data-insight': {
    name: '数据探索',
    projects: true,
    key: 'data-insight',
    icon: 'data-insight',
    rootPath: '/apps/data-insight/api/',
    create: '/apps/data-insight/workspace/new',
    view: 'tiling-wrapper'
  },

  // 'dataviz3d': {
  //     name: '数据上图3D',
  //     projects: true,
  //     key: 'dataviz3d',
  //     icon:'dataviz3d',
  //     rootPath: '/apps/dataviz3d/',
  //     create: '/apps/dataviz3d',
  //     view:'tiling-wrapper'
  // },

  'data-view': {
    name: '数据大屏',
    projects: true,
    key: 'data-view',
    icon: 'daping',
    rootPath: '/apps/data-view/api/',
    create: '/apps/data-view/select-template',
    view: 'tiling-wrapper'
  },

  'data-analysis': {
    name: '模型计算',
    projects: false,
  },

  'data-editor': {
    name: '数据探索',
    projects: false,
  },

  'bank-siting': {
    name: '银行选址',
    projects: false,
  }
}

let appsInUse = [{
    description: "",
    icon: "icon-dataviz",
    name: "dataviz",
    title: "数据上图"
  },
  {
    description: "",
    icon: "icon-data-insight",
    name: "data-insight",
    title: "数据探索"
  },
  {
    description: "",
    icon: "icon-data-analysis",
    name: "data-analysis",
    title: "模型计算"
  },
  // {
  //   description: "",
  //   icon: "icon-data-editor",
  //   name: "data-editor",
  //   title: "数据编辑"
  // },
  // {
  //     description:"",
  //     icon:"icon-dataviz3d",
  //     name:"dataviz3d",
  //     title:"数据上图3D"
  // },
  {
    description: "",
    icon: "icon-daping",
    name: "data-view",
    title: "数据大屏"
  },
  // {
  //     description:"在地图上,简单、快速地展示数据并分享给其他人",
  //     icon:"icon-daping",
  //     name:"daping",
  //     title:"大屏"
  // }
];

let defaultImg = ''


export {
  baseUrl,
  publicDataCategories,
  encodings,
  showWgs84DownloadOption,
  appNameMapping,
  appsInUse,
  defaultImg
}
